package com.xframe.common.config;

import com.xframe.common.core.interceptor.CredentialsInterceptor;
import com.xframe.common.core.service.CommandProcService;
import com.xframe.common.core.service.ExportAsyncService;
import com.xframe.common.core.service.register.CommandRegisterService;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@Log4j2
@AutoConfiguration
public class ServiceAutoConfiguration {




    @Bean
    public CommandRunTimeArgs initCommandRunTimeArgs() {
        CommandRunTimeArgs commandRunTimeArgs = new CommandRunTimeArgs();
        CommandRunTimeArgs.init(commandRunTimeArgs);
        return CommandRunTimeArgs.getRunTimeArgs();
    }

    @Bean(name = "register")
    public CommandRegisterService commandRegisterService() {
        return new CommandRegisterService();
    }
    @Bean
    public CommandProcService commandProcService() {

        log.info(CommandRunTimeArgs.getRunTimeArgs());
        return new CommandProcService();
    }

    @Bean
    public ExportAsyncService exportAsyncService() {
        return new ExportAsyncService();
    }
}
